<?php

namespace app\staff\controller;

use think\Db;
use think\Config;

class User extends Base
{
    public function index()
    {
        $state = Db::name('staff')->where([
            'id' => $this->staff_id,
        ])->value('state');
        return $this->success('获取成功', $state);
    }

    public function upstate()
    {
        $state = input('state');
        $res = Db::name('staff')->where([
            'id' => $this->staff_id,
        ])->update([
            'state' => $state
        ]);
        if ($res) {
            return $this->success('操作成功');
        }
        return $this->error('操作失败');
    }

}
